<template>
    <div>
        <ul>
            <li v-for="(item,index) in order" :key="index">
                <img :src="'http://localhost:8000/static/upload/' + item.img " width="50" >&nbsp;&nbsp;&nbsp;&nbsp;
                商品名：{{ item.username }} &nbsp;&nbsp;&nbsp;&nbsp;
                价格：{{ item.price }} &nbsp;&nbsp;&nbsp;&nbsp;
                
                评论数：{{ pl_num }}

            </li>
            <br/><br/>
            <li v-for="(item,index) in pl" :key="index">
                评论内容为：{{ item }}
            </li>

            <li>
                <button @click="go_hone">订单页面</button>
            </li>
        </ul>
    </div>
</template>


p_l()
<script>
export default {
    data(){
        return{
            cs:'',
            pl:[],
            order:[],
            pl_num:'',
        }
    },
    mounted() {
        this.pl = JSON.parse(localStorage.getItem('pl'))
        this.order.push(JSON.parse(localStorage.getItem('order')))
        
        this.pl_num = this.pl.length
    },
    methods: {
       //评论数
        go_hone(){
            this.$router.push('/myorder')
       }
    },
}
</script>